import Vue from 'vue'
import App from './App.vue'
import router from '@/router'
import store from '@/store'
import common from '@/libs/common'
import config from '@/config'
import YDUI from 'vue-ydui' /* 相当于import YDUI from 'vue-ydui/ydui.rem.js' */
import 'vue-ydui/dist/ydui.rem.css'
import VueWechatTitle from 'vue-wechat-title'
import VueValidator from 'vue-validator'

import { Confirm, Alert, Toast, Notify, Loading } from 'vue-ydui/dist/lib.rem/dialog'

import VConsole from 'vconsole'

if (config.debug) {
  let a = new VConsole()
  console.log(a)
}
// ----------------------

if (process.env.NODE_ENV !== 'production') require('@/mock')
Vue.use(YDUI)
Vue.use(VueWechatTitle)
Vue.use(VueValidator)

Vue.prototype.$dialog = {
  confirm: Confirm,
  alert: Alert,
  toast: Toast,
  notify: Notify,
  loading: Loading
}

Vue.config.productionTip = false
Vue.prototype.$common = common
Vue.prototype.$config = config
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
